package com.example.zluserservice.client;

import com.example.zluserservice.entity.UserRole;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author zhenliu（孙凌岳）
 * @Description 重构-拆分原来的权限客户端 权限服务-用户角色关联信息
 * @Date 2025/6/21 10:35
 * @Version 1.0
 */
@FeignClient(name = "zl-permission-service", path = "/permission/inner/user-role", contextId = "userRoleFeignClient")
public interface UserRoleFeignClient {
    /**
     * rpc调用UserRoleApi批量新增用户角色关联信息
     * @param userRoles
     * @return
     */
    @PostMapping("/batch-save")
    Integer batchInsert(@RequestBody List<UserRole> userRoles);

    /**
     * rpc调用UserRoleApi根据id删除用户角色关联信息
     * @param userId
     * @return
     */
    @DeleteMapping("/{userId}")
    Boolean deleteUserRoleByUserId(@PathVariable("userId") Long userId);

    /**
     * 删除多个用户的用户-角色关系
     */
    @PostMapping("/batch-delete")
    Boolean deleteUserRoleInUserId(@RequestBody List<Long> userIds);
}
